import java.math.BigDecimal;
import java.util.Objects;

public class Leet1603 {
    public static void main(String[] args) {
        BigDecimal x1 = new BigDecimal(1);
        BigDecimal x2 = new BigDecimal(3);
        System.out.println(x1.divide(x2,100000,BigDecimal.ROUND_HALF_UP).toString());
    }
    public double[] intersection(int[] start1, int[] end1, int[] start2, int[] end2) {
        BigDecimal x1 = new BigDecimal(end1[0]-start1[0]);
        BigDecimal y1 = new BigDecimal(end1[1]-start1[1]);
        BigDecimal x2 = new BigDecimal(end2[0]-start2[0]);
        BigDecimal y2 = new BigDecimal(end2[1]-start2[1]);
        BigDecimal k1 = x1.divide(y1, 20,BigDecimal.ROUND_HALF_UP);
        BigDecimal k2 = x2.divide(y2, 20,BigDecimal.ROUND_HALF_UP);
        if (Objects.equals(k1.toString(),k2.toString()))
            return new double[0];
        BigDecimal b1 = BigDecimal.valueOf(start1[0]).subtract(k1.multiply(BigDecimal.valueOf(start1[1])));
        BigDecimal b2 = BigDecimal.valueOf(start2[0]).subtract(k2.multiply(BigDecimal.valueOf(start2[1])));
        BigDecimal xx = (b2.subtract(b1)).divide(k1.subtract(k2),20,BigDecimal.ROUND_HALF_UP);
        BigDecimal yy = k1.multiply(xx);
        yy = yy.add(b1);
        double[] doubles = new double[2];
        doubles[0] = Double.parseDouble(String.valueOf(xx));
        doubles[1] = Double.parseDouble(String.valueOf(yy));
        return doubles;
    }
}
